home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / lvswin.zip / WIN_PRN.HPP < prev    next >
Text File  |  1991-10-17  |  3KB  |  85 lines

  1. /*
  2.  *            LVS Windows
  3.  *      The Window Class System
  4.  *
  5.  *        Copyright 1991 (c), Lake View Software
  6.  *                            4321 Harborough Rd.
  7.  *                            Columbus, OH 43220
  8.  *        All rights reserved.
  9.  */
  10. // Win_Prn.hpp
  11.  
  12. #ifndef WIN_PRN_HPP
  13. #define WIN_PRN_HPP
  14.  
  15. #include <stdio.h>
  16. #include "winobj.hpp"
  17.  
  18. // Default printer setup codes
  19. #define EPSON_INIT         "t1"
  20. #define EPSON_RESET        ""
  21. #define EPSON_UNDERLINE     "-1"
  22. #define EPSON_BOLD        "E"
  23. #define EPSON_COMPRESS        "\x0f"
  24. #define EPSON_NORMAL        "-0F"
  25.  
  26. #pragma warn -par
  27.  
  28. class Win_Prn:public WinObj
  29. {
  30.     protected:
  31.     void display()          // Display window contents on top
  32.         { needs_display = 0;};  // Fake for virtual
  33.     void update(int start_pos,int len)     // Fake for virtual
  34.         { needs_display = 0;};  // Update a portion of window
  35.  
  36.     char *prn_port;
  37.     FILE *fp;
  38.  
  39.     char *Init;
  40.     char *Reset;
  41.     char *Underline;
  42.     char *Bold;
  43.     char *Normal;
  44.     char *Compress;
  45.  
  46. public:
  47.     Win_Prn (char *port="LPT1", int v_h=66,int v_w=132);
  48.     ~Win_Prn();
  49.     int open (int sr, int sc, int er, int ec, // Fake an open for virtual
  50.             int btype = W_DOUBLE, int wattr = _BLACK|LGREY,
  51.             int battr = _BLACK|LGREY);
  52.     int open ();
  53.     int Win_Prn::change_port (char *new_port);
  54.     void shadow(int on_off=W_ON) {};     // Fake Turn window shadow on/off
  55.     void update() {needs_display = 0;};  // Fake update
  56.     void show_cursor() {};               // Show cursor in window
  57.     void close();                        // Close the window object.
  58.     void set_active() {};                // fake makes window current window
  59.     int get_key(int echo=W_NOECHO, int seconds = 0) {return 0;};
  60.     int read (int clear=1) {clear_gets(); return 0;}; // Dummy Read all defined gets
  61.  
  62.     /* Window Movement */
  63.     void hide() {};                     // Dummy Hide window
  64.     void unhide() {};                   // Dummy Show window
  65.     int move(int new_y,int new_x) {return W_OK;};   // Dummy Move the window
  66.     int size(int new_height,int new_width) {return W_OK;}; // DummyResize 
  67.     int print_page (int count = 1);        // send page to the printer
  68.     void clean_page () {clr_win();};    // make a Clean page
  69.  
  70.     void set_pageattr (int new_attr);  // changes the entire pages attributes
  71.     
  72.     /* Printer setup strings */
  73.     void define_init (char *new_init);
  74.     void define_reset (char *new_reset);
  75.     void define_underline (char *new_underline);
  76.     void define_bold (char *new_bold);
  77.     void define_compress (char *new_compress);
  78.     void define_normal (char *new_normal);
  79. };
  80.  
  81. #pragma warn +par
  82.  
  83.  
  84. #endif   /* WIN_PRN_HPP */
  85.